#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    IplImage* pImg;
     pImg=cvLoadImage("D:/MachineVision.jpg",1);
      cvNamedWindow( "Image", 1 );//创建窗口
      cvShowImage( "Image", pImg );//显示图像
      cvWaitKey(0); //等待按键
      cvDestroyWindow( "Image" );//销毁窗口
      cvReleaseImage( &pImg ); //释放图像
}

MainWindow::~MainWindow()
{
    delete ui;
}
